package com.loong.user.helper;

import com.loong.common.utils.TransformUtils;
import com.loong.global.dto.MemberDTO;
import com.loong.user.business.MemberBusiness;
import com.loong.user.model.Member;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class UserCacheHelper {

    @Resource
    private MemberBusiness memberBusiness;

    public void initMemberCache(Long userId){
        MemberDTO memberDTO = new MemberDTO();
        Member member = memberBusiness.findByUserId(userId);
        TransformUtils.transform(member,memberDTO);
    }
    public void initAdminCache(Long userId){
        MemberDTO memberDTO = new MemberDTO();
        Member member = memberBusiness.findByUserId(userId);
        TransformUtils.transform(member,memberDTO);
    }
}
